﻿using PF;
using UnityEngine;
using ETModel;
using System.Collections.Generic;

namespace ETHotfix {

    [ObjectSystem]
    public class UnitAwakeSystem : AwakeSystem<Unit, long> {
        public override void Awake(Unit self, long playerId) {
            self.Awake(playerId);
        }
    }

    /// <summary>
    /// 所有单位的基类
    /// </summary>
    public abstract class Unit : Entity {

        /// <summary>
        /// 所属玩家ID
        /// </summary>
        public long PlayerId { get; set; }


        public abstract Vector3 GetPosition();
        public abstract void SetPosition(Vector3 pos);
        /// <summary>
        /// 获取移动速度(每秒移动距离)
        /// </summary>
        /// <returns></returns>
        public abstract float GetMoveSpeed();
        

        public void Awake(long playerId) {
            PlayerId = playerId;
        }
        public override void Dispose() {
            if (this.IsDisposed) {
                return;
            }
            base.Dispose();
        }
    }
}